<?php

namespace app\models;

/**
 * This is the model class for table "yaojiang_record".
 *
 * @property integer $id
 * @property string $ip
 * @property string $open_id
 * @property string $nickname
 * @property integer $is_winning
 * @property integer $prize
 * @property integer $is_receive
 * @property integer $stroe_id
 * @property integer $update_time
 * @property integer $create_time
 */
class YaojiangRecord extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'yaojiang_record';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['is_winning', 'prize', 'is_receive', 'store_id', 'update_time', 'create_time'], 'integer'],
            [['ip', 'open_id', 'prize_name'], 'string', 'max' => 100],
            [['nickname'], 'string', 'max' => 500],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'ip' => 'Ip',
            'open_id' => 'Open ID',
            'nickname' => 'Nickname',
            'is_winning' => 'Is Winning',
            'prize' => 'Prize',
            'prize_name' => 'Prize Name',
            'is_receive' => 'Is Receive',
            'store_id' => 'Store ID',
            'update_time' => 'Update Time',
            'create_time' => 'Create Time',
        ];
    }

    public function getStore()
    {
        return $this->hasMany(StoreInformaction::className(),['id'=>'store_id']);
    }
}
